package com.ybu.service.impl;

import com.ybu.mapper.DistrictMapper;
import com.ybu.pojo.entity.District;
import com.ybu.service.DistrictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DistrictServiceImpl implements DistrictService {
    @Autowired
    private DistrictMapper districtMapper;

    @Override
    public List<District> getDistrictByParent(String parent) {
        List<District> list = districtMapper.selectDistrictByParent(parent);
        for (District district:list){
            district.setId(null);
            district.setParent(null);
        }
        return list;
    }
}
